import SortAlgotithm.BubbleSort;
import SortAlgotithm.MergeSorter;
import SortAlgotithm.QuickSort;
import 剑指offer.*;


import java.util.ArrayList;
import java.util.Iterator;
import java.util.Objects;


public class Main {

    public static void test() {
        ArrayList<Integer> arrayList = new ArrayList<>();
        arrayList.add(5);
        arrayList.add(4);
        arrayList.add(3);
        arrayList.add(2);
        arrayList.add(1);
        Iterator<Integer> iterator = arrayList.iterator();
        while (iterator.hasNext()) {
            Integer integer = iterator.next();
            System.out.println(integer);
                iterator.remove();

        }
        System.out.println(arrayList);
    }
    public static void testObject(Object ...obj) {
        StringBuilder stringBuilder = new StringBuilder();
        for(Object o : obj) {
            if(o == null) {
                return;
            }
            stringBuilder.append(o.toString());
        }

        System.out.println(stringBuilder.toString());
    }
    public static void main(String[] args) {
     //   PrintPermutationAndCombinationOfString printPermutationAndCombinationOfString = new PrintPermutationAndCombinationOfString();
        int []data = {14,12,15,13,11,16};
        MergeSorter mergeSorter = new MergeSorter();
        mergeSorter.mergeSorter(data, 0, data.length - 1);
//        FirstNotRepeatingChar firstNotRepeatingChar = new FirstNotRepeatingChar();
//        System.out.println(firstNotRepeatingChar.FirstNotRepeatingChar("abcdefghab"));
//        GetUglyNumber getUglyNumber = new GetUglyNumber();
//        getUglyNumber.GetUglyNumber_Solution(1);
//        int []number = {5,4,3,2,1};
//        PrintMinNumber printMinNumber = new PrintMinNumber();
//        System.out.println(printMinNumber.PrintMinNumber(number));
//        NumberOf1Between1AndN_Solution numberOf1Between1AndN_solution = new NumberOf1Between1AndN_Solution();
//        System.out.println(numberOf1Between1AndN_solution.NumberOf1Between1AndN_Solution(-1));
//        int []array = {1,-2,3,10,-4,7,2,-5};
//        FindGreatestSumOfSubArray findGreatestSumOfSubArray = new FindGreatestSumOfSubArray();
//        int temp = findGreatestSumOfSubArray.FindGreatestSumOfSubArray(array);
//        System.out.println(temp);
//        int [] array = {4,5,1,6,2,7,3,8};
//        GetLeastNumbersFromArray getLeastNumbersFromArray = new GetLeastNumbersFromArray();
//        ArrayList<Integer> arrayList = getLeastNumbersFromArray.GetLeastNumbers_Solution(array, 8);
//        for (int i : arrayList) {
//            System.out.println(i);
//        }
//        FindMoreThanHalfNumFromArray findMoreThanHalfNumFromArray = new FindMoreThanHalfNumFromArray();
//        System.out.println(findMoreThanHalfNumFromArray.MoreThanHalfNum_Solution(array));
//        TreeNode treeNode = new TreeNode(10);
//        treeNode.left = new TreeNode(6);
//        treeNode.right = new TreeNode(14);
//        treeNode.right.left = new TreeNode(12);
//        treeNode.right.right = new TreeNode(16);
//        treeNode.left.left = new TreeNode(4);
//        treeNode.left.right = new TreeNode(8);
//        ConvertBSTAsDLL convertBSTAsDLL = new ConvertBSTAsDLL();
//        convertBSTAsDLL.Convert(treeNode);


//        RandomListNode randomListNode1 = new RandomListNode(1);
//        RandomListNode randomListNode2 = new RandomListNode(2);
//        RandomListNode randomListNode3 = new RandomListNode(3);
//        RandomListNode randomListNode4 = new RandomListNode(4);
//        randomListNode1.next = randomListNode2;
//        randomListNode1.random = randomListNode3;
//        randomListNode2.next = randomListNode3;
//        randomListNode2.random = randomListNode1;
//        randomListNode3.next = randomListNode4;
//        randomListNode4.random = randomListNode4;
//
//
//        CopyComplexLinked copyComplexLinked = new CopyComplexLinked();
//        copyComplexLinked.Clone(null);

//        TreeNode treeNode = new TreeNode(10);
//        treeNode.left = new TreeNode(5);
//        treeNode.right = new TreeNode(12);
//        treeNode.right.left = new TreeNode(11);
//        treeNode.right.right = new TreeNode(13);
//        treeNode.left.left = new TreeNode(4);
//        treeNode.left.left.left = new TreeNode(3);
//        treeNode.left.left.right = new TreeNode(2);
//        treeNode.left.right = new TreeNode(7);
//        treeNode.left.right.left = new TreeNode(1);
//        treeNode.left.right.right = new TreeNode(8);
//        FindPath findPath = new FindPath();
//        findPath.DepTraverse(treeNode);
//        int []arr = {4,8,6,12,15,17,16,14};
//        int []arr = {};
//        VerifySquenceOfBST verifySquenceOfBST = new VerifySquenceOfBST();
//        boolean b = verifySquenceOfBST.VerifySquenceOfBST(arr);
//        System.out.println(b);
//       test();
//        IsPopOrder isPopOrder = new IsPopOrder();
//        int []pushA = {1};
//        int []popA = {2};
//        boolean is = isPopOrder.IsPopOrder(pushA,popA);
//        System.out.println(is);
        // ["PSH3","MIN3","PSH4","MIN3","PSH2","MIN2","PSH3", "MIN2", "POP","MIN2","POP","MIN3","POP","MIN3","PSH0","MIN"]
        // 3,3,2,2,2,3,3,0
        // 3,
//        int min;
//        FindStackMin findStackMin = new FindStackMin();
//        findStackMin.push(3);
//        min = findStackMin.min();
//        System.out.print(min+",");
//        System.out.println(findStackMin.stack);
//
//        findStackMin.push(4);
//        min = findStackMin.min();
//        System.out.print(min+",");
//        System.out.println(findStackMin.stack);
//
//        findStackMin.push(2);
//        min = findStackMin.min();
//        System.out.print(min+",");
//        System.out.println(findStackMin.stack);
//
//        findStackMin.push(3);
//        min = findStackMin.min();
//        System.out.print(min+",");
//        System.out.println(findStackMin.stack);
//
//        findStackMin.pop();
//        min = findStackMin.min();
//        System.out.print(min+",");
//        System.out.println(findStackMin.stack);
//
//        findStackMin.pop();
//        min = findStackMin.min();
//        System.out.print(min+",");
//        System.out.println(findStackMin.stack);
//
//        findStackMin.pop();
//        min = findStackMin.min();
//        System.out.print(min+",");
//        System.out.println(findStackMin.stack);
//
//        findStackMin.push(0);
//        min = findStackMin.min();
//        System.out.print(min+",");
//        System.out.println(findStackMin.stack);

//        int [][] matrix = {
//                {1,2,3,4,5},
//                {6,7,8,9,10},
//                {11,12,13,14,15}
//        };
//        PrintMatrix printMatrix = new PrintMatrix();
//        ArrayList<Integer> arrayList = printMatrix.printMatrix(matrix);
//        for (Integer i : arrayList) {
//            System.out.print(i + "  ");
//        }
    }
}
